<%--
  Created by IntelliJ IDEA.
  User: liyong
  Date: 2010-9-1
  Time: 17:57:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/pages/inc/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="decorator" content="default.index">
    <script type="text/javascript" src="/js/checkPassword.js"></script>
    <style type="text/css">
        .tips-warning {
            display: none;
            float: left;
            margin-left: 5px;
        }
    </style>
    <script type="text/javascript">

        $(function() {
            $("#modifyPassword").click(function() {
                if (checkPassword()) {
                    var oldPassword = $("#oldPassword").val();
                    var newPassword = $("#newPassword").val();
                    var reNewPassword = $("#reNewPassword").val();
                    $.ajax({
                        type: "POST",
                        url: "${ctx}/account/modifypassword.aspx",
                        data: "oldPassword=" + oldPassword + "&newPassword=" + newPassword + "&reNewPassword=" + reNewPassword,
                        dataType:"json",
                        success: function(msg) {
                            if (msg.result == "errorPassword") {
                                $("#resultOldPassword").addClass("tips-explain tips-error").css('display','block').html("您输入的旧密码错误");
                            } else {
                                $(".popbg").css("height", $(document).height() + "px").css("width", document.documentElement.scrollWidth + "px").show();
                                $(".pop-content").css("left", $(document).width() / 2 - $('.pop-content').width() / 2 - 18 + "px");
                                $('.pop-content').show();
                            }
                        }
                    });
                }
            })
        })
    </script>
</head>

<body>
        <div class="rightblock">
            <h3>修改登录密码</h3>

            <div class="allfield"><label><span>* 项表示必填选项</span></label></div>
            <%--<spring:bind path="modifyPasswordCommand.oldPassword">--%>
            <div class="allfield"><label><span>*</span>旧密码：</label>
                <input type="password" class="input-text" id="oldPassword" name="oldPassword"/>

                <div class="tips-explain tips-warning">请输入原密码</div>
                <span id="resultOldPassword"></span>
            </div>
            <%--</spring:bind>--%>
            <%--<spring:bind path="modifyPasswordCommand.newPassword">--%>
            <div class="allfield"><label><span>*</span>新密码：</label>
                <input type="password" class="input-text" name="newPassword" id="newPassword"/>

                <div class="tips-explain tips-warning">请设置网站的登录密码（密码长度为6到16位的字母与数字组合）</div>
                <span id="resultNewPassword"></span>
            </div>
            <%--</spring:bind>--%>
            <%--<spring:bind path="modifyPasswordCommand.reNewPassword">--%>
            <div class="allfield"><label><span>*</span>重复新密码：</label>
                <input type="password" class="input-text" name="reNewPassword" id="reNewPassword"/>

                <div class="tips-explain tips-warning">请再次输入登录密码</div>
                <span id="resultRePassword"></span>
            </div>
            <%--</spring:bind>--%>
            <div class="allfield sbm-button"><label>&nbsp;</label>
                <span class="btn-right">
                <input type="button" value="保存" class="btn" style="width:60px;" id="modifyPassword"/></span>
                <%--<label style="width:50px;">&nbsp;</label>--%>
                <%--<span class="cl-btn-right">--%>
                    <%--<input type="button" value="返回"--%>
                           <%--class="cl-btn"--%>
                           <%--style="width:60px;"--%>
                           <%--onclick="history.back();"/></span>--%>
                &nbsp;&nbsp;<a href="javascript:" onclick="history.back()">返回</a> 
            </div>
        </div>
</body>
</html>